home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_gen_slashvine_talk.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  107 lines

  1. # Jones 3D Cog Script
  2. #
  3. # gen_Slashvine_talk.cog
  4. #
  5. # Damage the face with Machete to allow move through. 
  6. # Added Indy sayline for bumping into.[SXC & DS]
  7. #
  8. # [TRM & SXC & DS]
  9. #
  10. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  11. # ========================================================================================
  12.  
  13. symbols
  14.  
  15.     message        damaged
  16.     message        touched
  17.  
  18.     sound        touchvines
  19.  
  20.     surface        vines                mask=0x408
  21.     surface        vinesback            mask=0x408
  22.  
  23.     template    leafTpl=slashLeaves    local
  24.     template    vineGhost=ghost        local
  25.  
  26.     thing        player                local
  27.     thing        leaf                local
  28.     thing        leafpos                local
  29.  
  30.     int            tutch=0                local
  31.     int            direction=0            local
  32.     int            facedir=0            desc=0-north,1-south,2-east,3-west
  33.     int            leafNum=0            local
  34.     int            numLeaves=2            local
  35.  
  36.     flex        playery=0            local
  37.     flex        playerx=0            local
  38.  
  39.     vector        playervec            local
  40.  
  41. end
  42.  
  43. # ========================================================================================
  44.  
  45. code
  46.  
  47. damaged:
  48.  
  49.     # See if damage is from machete -- RT
  50.     if (GetParam(1) == 0x20)
  51.     {
  52.         SetWallCel(vines, 1);
  53.         SetWallCel(vinesback, 1);
  54.         ClearAdjoinFlags(vines, 0x10);
  55.         SetAdjoinFlags(vinesback, 0x2);
  56.  
  57.         # Make leaves...
  58.         leafpos = CreateThingAtPos(vineGhost, GetSurfaceSector(vines), GetSurfaceCenter(vines), '0 0 0');
  59.         
  60.         for(leafNum = 0; leafNum < numLeaves; leafNum = leafNum + 1)
  61.         {
  62.             leaf = CreateThing(leafTpl, leafpos);
  63.             SetThingVel(leaf, VectorScale('0.0 0.0 -0.1', 0.7));
  64.         }
  65.  
  66.         tutch=1;
  67.     }
  68.     return;
  69.  
  70. # ========================================================================================
  71.  
  72. touched:
  73.  
  74.     if (tutch == 1) return;
  75.  
  76.     player = GetLocalPlayerThing();
  77.  
  78.     playervec = GetThingLVec(player);
  79.     playery = VectorY(playervec);
  80.     playerx = VectorX(playervec);
  81.  
  82.     if ((playery > 0) && ((playerx > -0.7) && (playerx < 0.7)))
  83.     {
  84.         direction = 0;    # North
  85.     }
  86.     else if ((playery < 0) && ((playerx > -0.7) && (playerx < 0.7)))
  87.     {
  88.         direction = 1;    # South
  89.     }
  90.     else if ((playerx > 0) && ((playery > -0.7) && (playery < 0.7)))
  91.     {
  92.         direction = 2;    # East
  93.     }
  94.     else if ((playerx < 0) && ((playery > -0.7) && (playery < 0.7)))
  95.     {
  96.         direction = 3;    # West
  97.     }
  98.  
  99.     if (direction == facedir)
  100.     {
  101.         PlayVoice(player, touchvines, 1.0, 0);
  102.         tutch=1;
  103.     }
  104.     return;
  105.  
  106. end
  107.